package com.itheima.demo1;

import java.util.Scanner;

public class Demo20ArrayWork {
    public static void main(String[] args) {
        //编程竞赛，6个评委为选手打分，分数为0-100的整数分，选手最后得分为去除最高和最低，取均值
        int[] air = new int[6];
        Scanner sc = new Scanner(System.in);
        for (int i = 0; i < air.length; i++) {
            air[i] = sc.nextInt();
            if (air[i] < 0 | air[i] > 100) {
                System.out.println("0-100");
                i--;
            }
        }
        int max = air[0];
        int min = air[0];
        int sum = 0;
        for (int i = 1; i < air.length; i++) {
            if (max < air[i]) {
                max = air[i];
            } else if (min > air[i]) {
                min = air[i];
            }
        }
        System.out.println(max);
        System.out.println(min);
        for (int i = 0; i < air.length; i++) {
            sum += air[i];
        }
        int average = (sum - max - min) / (air.length - 2);
        System.out.println(average);


    }
}
